package com.dataextend.service.impl;

import com.dataextend.mapper.cluster.RoleMenusDao;
import com.dataextend.entity.RoleMenusEntity;
import com.dataextend.service.RoleMenusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoleMenusServiceImpl implements RoleMenusService {

    @Autowired
    private RoleMenusDao roleMenusDao;

    @Override
    public int add(RoleMenusEntity roleMenusEntity) {
        return roleMenusDao.add(roleMenusEntity);
    }

    @Override
    public int update(RoleMenusEntity roleMenusEntity) {
        return roleMenusDao.update(roleMenusEntity);
    }

    @Override
    public void delete(Long id) {
        roleMenusDao.delete(id);
    }

    @Override
    public RoleMenusEntity queryById(Long id) {
        return roleMenusDao.queryById(id);
    }

    @Override
    public List<RoleMenusEntity> list(RoleMenusEntity roleMenusEntity) {
        return roleMenusDao.list(roleMenusEntity);
    }


    @Override
    public void deleteRoleId(Long roleId) {
        roleMenusDao.deleteRoleId(roleId);
    }

    @Override
    public void addRoleMenus(Long roleId, Long menusId) {
        roleMenusDao.addRoleMenus(roleId, menusId);
    }
}
